<template>
  <div class="nav">
    <el-col :span="4">
      <el-menu
        :default-active="active"
        background-color="#545c64"
        text-color="#fff"
        @select="handleSelect"
        active-text-color="#ffd04b">
        <router-link to="/index/" tag="div">
          <el-menu-item index="1">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>首页</span>
              </template>
          </el-menu-item>
        </router-link>
        <el-submenu index="2">
          <template slot="title">
            <i class="el-icon-location"></i>
            <span>订单</span>
          </template>
          <el-menu-item-group>
            <router-link to="/index/orderWaiting" tag="div">
              <el-menu-item index="2-1" tag="el-menu-item">
                <i class="el-icon-warning"></i>
                待接单
              </el-menu-item>
            </router-link>
            <router-link to="/index/orderPending" tag="div">
              <el-menu-item index="2-2">
                <i class="el-icon-loading"></i>进行中订单
              </el-menu-item>
            </router-link>
            <router-link to="/index/orderCancel" tag="div">
              <el-menu-item index="2-3">
                <i class="el-icon-close"></i>已取消订单
              </el-menu-item>
            </router-link>
            <router-link to="/index/orderComplete" tag="div">
              <el-menu-item index="2-4">
                <i class="el-icon-circle-check"></i>已完成订单
              </el-menu-item>
            </router-link>
          </el-menu-item-group>
        </el-submenu>
        <el-submenu index="3">
          <template slot="title">
            <i class="el-icon-location"></i>
            <span>商品</span>
          </template>
          <el-menu-item-group>
            <router-link to="/index/goodsSelling" tag="div">
              <el-menu-item index="3-1"><i class="el-icon-goods"></i>销售中商品</el-menu-item>
            </router-link>
            <router-link to="/index/goodsAdd" tag="div">
              <el-menu-item index="3-2"><i class="el-icon-circle-plus"></i>添加商品</el-menu-item>
            </router-link>
            <router-link to="/index/goodsRemain" tag="div">
              <el-menu-item index="3-3"><i class="el-icon-sold-out"></i>库存</el-menu-item>
            </router-link>
          </el-menu-item-group>
        </el-submenu>
        <router-link to="/index/sellDetail" tag="div">
          <el-menu-item index="4">
            <i class="el-icon-document"></i>
            <span slot="title">销售</span>
          </el-menu-item>
        </router-link>
        <el-submenu index="5">
          <template slot="title">
            <i class="el-icon-location"></i>
            <span>账户管理</span>
          </template>
          <el-menu-item-group>
            <router-link to="/index/PutForward" tag="div">
              <el-menu-item index="5-1"><i class="el-icon-goods"></i>我要提现</el-menu-item>
            </router-link>
            <router-link to="/index/shopInfoAlter" tag="div">
              <el-menu-item index="5-2"><i class="el-icon-circle-plus"></i>店铺信息修改</el-menu-item>
            </router-link>
            <router-link to="/index/shoperInfoAlter" tag="div">
              <el-menu-item index="5-3"><i class="el-icon-sold-out"></i>商家信息修改</el-menu-item>
            </router-link>
          </el-menu-item-group>
        </el-submenu>
        <router-link to="/index/systemNotice" tag="div">
          <el-menu-item index="6">
            <i class="el-icon-bell"></i>
            <span slot="title">系统消息</span>
          </el-menu-item>
        </router-link>
      </el-menu>
    </el-col>
  </div>
</template>

<script>
export default {
  name: 'Nav',
  data () {
    return {
      active: '1'
    }
  },
  methods: {
    handleSelect (key) {
      this.active = key
    }
  }
}
</script>
<style lang="stylus" scoped>
  @import "../../assets/css/base.styl"
  .nav
    width: $width
    margin: 0 auto
    .el-submenu
      .el-menu-item
        min-width auto
        padding-left 26px !important
</style>
